package com.web;

import com.pojo.GongYi_x;
import com.service.GongYiService_x;
import com.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("gongyi")
public class GongYiController_x {
    @Autowired
    private GongYiService_x gongYiServiceX;
    @RequestMapping("select")
    public List<GongYi_x> selectAll() {
        return gongYiServiceX.selectAll();
    }
    @RequestMapping("show")
    public List<GongYi_x> select1(){
        return gongYiServiceX.select1();
    }

    @RequestMapping("add")
    Result add(GongYi_x gongYiX){
        return Result.ok(gongYiServiceX.add(gongYiX));
    }
    @RequestMapping("update")
    Result update(GongYi_x gongYiX){
        return Result.ok(gongYiServiceX.update(gongYiX));
    }
    @RequestMapping("delete")
    Result delete(Integer id){
        return Result.ok(gongYiServiceX.delete(id));
    }
    @RequestMapping("/selectAll")
    public List<GongYi_x> select(Integer id, String title) {
        return gongYiServiceX.select(id, title);
    }
}
